package org.xukai.common.spel;


/**
 * Created by ZuoYun on 2014/8/29.
 * Time: 20:55
 * Information:
 */

public class ComboDetailFiled<T> {

    Class<T> DomainClazz;
    Boolean useAnotherDomain=false;
    /**
     * 字段所在的领域类信息
     */
    String anotherDomainName;
    /**
     * 键值名称所对应的领域的字段名称，一般领域为POJO的领域模型，例如模型中有个字段为name，那么这个fieldName应该为name
     */
    String fieldName;

    /**
     * 作为fieldName替补的字段
     * 当fieldName为null或者""时，使用该字段进行取值
     */
    private String subFieldName;

    public Boolean getUseAnotherDomain() {
        return useAnotherDomain;
    }

    public Class<T> getDomainClazz() {
        return DomainClazz;
    }

    public ComboDetailFiled<T> isUseAnotherDomain() {
        this.useAnotherDomain=true;
        return  this;
    }

    public String getAnotherDomainName() {
        return anotherDomainName;
    }

    public ComboDetailFiled<T> setAnotherDomainName(String anotherDomainName, Class<T> domainClazz) {
        this.anotherDomainName = anotherDomainName;
        DomainClazz = domainClazz;
        this.useAnotherDomain=true;
        return  this;
    }

    public String getFieldName() {
        return fieldName;
    }

    public ComboDetailFiled<T> setFieldName(String fieldName) {
        this.fieldName = fieldName;
        return this;
    }

    public String getSubFieldName() {
        return subFieldName;
    }

    public ComboDetailFiled<T> setSubFieldName(String subFieldName) {
        this.subFieldName = subFieldName;
        return this;
    }

}